
var creatLine = function aa(i,v){
    var addul = $('<ul></ul>').attr("style", "list-style-type:none");
    var addli = $('<li></li>').appendTo(addul);
    var addspan1 = $('<span></span>').addClass("name11").html("评论内容:"+ v.content).appendTo(addli);
    var addbr = $('<br>').appendTo(addli);
    var addbspan2 = $('<span></span>').attr("style", "float:right").html((i+1)+"楼&nbsp;&nbsp;&nbsp;姓名:"+v.username+"&nbsp;&nbsp;&nbsp;时间"+v.time).appendTo(addli);
   /* var add=$('<hr>').appendTo(addli);*/
    var addbr = $('<br>').appendTo(addli);
    return addul
}

var totalPage = 0
var totalRecords=0

//查询总条数和总页数
ajax(addhead+"queryComment",nowPage,false,
    function(res){
        totalPage=res.totalPage;
        totalRecords=res.totalRecords;
        }
    ,function(){alert("失败")})

ops={
    "totalPage" : totalPage,
    "totalRecords" : totalRecords//总条数
}


addPagination("mm",ops,addhead + "queryComment",creatLine);

var save = function save(){
    var data={
        //userid:   $("#userid").val(),
        username: $("#username").val(),
        content:  $("#content").val()
    }
    //addhead + "addComment"就是url,data就是穿的参数比如传入了{name:"wzp",age=12},false异步,成功回调,失败回调
    ajax(addhead + "addComment",data,false,function(vvv){},function (){alert("失败")});
}

function addComment(){
    $('#myModal').modal({keyboard: true});
    $('#fffg').bindClick(save,2000);
    //$('#myModal').modal("hide");
}



